<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="pojo.*,dao.*,service.*,servlet.*,java.util.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>商品显示</h1>
<%
PageBean<Product> pb = (PageBean<Product>)(request.getAttribute("pb"));
List<Product> List=pb.getList();
%>
<table border="1">
<%
for(Product p:List){
%>
<tr><td><%=p.getP_type() %></td>
<td><%=p.getP_name() %></td>
<td><%=p.getP_id() %></td>
<td><img src="<%=p.getP_image()%>" width="50px" height="25px"/></td>
<td><%=p.getP_quantity() %></td>
<td>&yen;<%=p.getP_price() %></td>
<td><a href="<%=request.getContextPath()%>/ProductServlet?method=up&p_id=<%=p.getP_id()%>">修改</a></td>
<td><a href="<%=request.getContextPath()%>/ProductServlet?method=del&p_id=<%=p.getP_id()%>">删除</a></td>
<td><a href="<%=request.getContextPath()%>/CartServlet?method=add&p_id=<%=p.getP_id()%>">购买</a></td>
</tr>
<%} %>
</table>
<h3><a href="add.jsp">添加商品</a></h3>
导航：
<%
int maxPage = pb.getTotalPage();
for(int i=1;i<=maxPage;i++){
%>
<a href="<%=request.getContextPath()%>/ProductServlet?method=showAll&currentPage=<%=i%>">
[<%=i %>]
</a>
<%} %>
</body>
</html>